package com.le.tester.javaThink.fifth.chapter13_FuncProgramming;

/**
 * 描述：使用注解是要使用函数式方法
 */
@FunctionalInterface
interface Functional {
    String goodbye(String arg);
}

interface FunctionalNoAnn {
    String goodbye(String arg);
}

public class FunctionalAnnotation {
    public String goodbye(String arg) {
        return "GoodBye," + arg;
    }

    public static void main(String[] args) {
        FunctionalAnnotation functionalAnnotation = new FunctionalAnnotation();
        Functional f = functionalAnnotation::goodbye;
        FunctionalNoAnn fna = functionalAnnotation::goodbye;

        Functional fl = a -> "GoodBye," + a;
        FunctionalNoAnn fnal = a -> "GoodBye," + a;
    }
}
